package cn.bb.bbstudy.controller;

import cn.bb.bbstudy.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class CommentController {

    @Autowired
    CommentService commentService;

    @GetMapping("/comment/delete/{uid}/{cid}")
    public String deleteComment(@PathVariable String uid,@PathVariable String cid) {
        commentService.deleteCommentByCid(cid);
        //等于刷新该页面
        return "redirect:/user/comment/" + uid;

    }
}
